package day32;

// 不会！！

// 淘宝网店：
// 素数月份：每天1元，非素数，每天2元

import java.util.Scanner;

public class Main1 {
    // 判断闰年
    private static boolean isLeap(int year) {
        return ((year%4==0&&year%100!=0) || (year%400==0));
    }

    public static void main(String[] args) {
        int[] prim = {2,3,5,7,11}; // 每天1
        int[] odd = {1,4,6,8,9,10,12}; // 每天2
        int[] days = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        int[] moneys = {0,62,28,31,60,31,60,31,62,60,62,30,62};
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int fYear = in.nextInt();
            int fMonth = in.nextInt();
            int fDate = in.nextInt();
            int tYear = in.nextInt();
            int tMonth = in.nextInt();
            int tDate = in.nextInt();

            // 每4年一闰年，就会多1块钱
            int year = tYear - fYear -1;
            int everyYear = 28+31*3+30 + (31*4+30*3)*2 ; // 按平年计算
            int money = 0;
            if(year > 0) {
                money += everyYear*year;
                if(year %4 ==0) {
                    money += 1;
                }
            }
            // 中间月份数
            for (int i = fMonth+1; i < tMonth; i++) {
                money += moneys[i];
            }
            // 判断闰年 + 跨过了2 -- 就加1
            if(isLeap(fYear) && (fMonth<tMonth) && (fMonth<=2 && tMonth>2)) {
                money += 1;
            }

            // 日期：每个月（起止）
            if(fMonth != tMonth) {
                int tmp1 = days[fMonth] - fDate +1;
                int tmp2 = tDate - 0;
                if((fMonth==2) || (fMonth==3) || (fMonth==5) || (fMonth==7) || (fMonth==11)) {
                    money += tmp1 ;
                } else {
                    money += tmp1*2;
                }
                if((fMonth==2) || (fMonth==3) || (fMonth==5) || (fMonth==7) || (fMonth==11)) {
                    money += tmp2 ;
                } else {
                    money += tmp2*2;
                }
            } else {
                int tmp = tDate-fDate + 1;
                if((fMonth==2) || (fMonth==3) || (fMonth==5) || (fMonth==7) || (fMonth==11)) {
                    money += tmp ;
                } else {
                    money += tmp*2;
                }
            }
            System.out.println(money);
        }
    }
}
